Plotting pulse propagation along a transmission

First, import required modules

Can make use of heaviside function to construct a square pulse. First, create a list of times and then plot the heaviside function.

Define a function to construct a square pulse.

Call our function and plot the result.

Prepare some values needed to construct the voltage at the input of the transmission line.

Finally, calculate and plot $v_\mathrm{in}$.